﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using DotLiquid;
using PasteBuilder.handler;

namespace PasteBuilder.Models
{
    /// <summary>
    /// 对象属性 字段的属性
    /// </summary>
    public class ClassProperty : Drop
    {
        /// <summary>
        /// 属性类型 可能带了Dto
        /// </summary>
        public string PropertyType { get; set; }

        /// <summary>
        /// 上面这个的基类，不带Dto，干净的个体
        /// </summary>
        public string PropertyBase { get; set; }

        /// <summary>
        /// 属性名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 首字母小写
        /// </summary>
        public string lowerName
        {
            get
            {
                return CommonHelper.FirstCharToLower(Name);
            }
        }

        /// <summary>
        /// 属性中文名称
        /// </summary>
        public string CnName { get; set; }

        /// <summary>
        /// 是否必填
        /// </summary>
        public bool Required { get; set; } = false;

        /// <summary>
        /// 最大长度 -1表示不启用MaxLength
        /// </summary>
        public int MaxLength { get; set; } = -1;

        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultValue { get; set; } = "";

        /// <summary>
        /// 属性特性
        /// </summary>
        public List<ClassAttribute> ClassAttributes { get; set; }

        /// <summary>
        /// 是否是其他的模型
        /// </summary>
        public bool boolOtherModel { get; set; }

        /// <summary>
        /// 注释是啥
        /// </summary>
        public string PropertyDisplayStr { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string DisplayStr { get { return PropertyDisplayStr; } }

        /// <summary>
        /// 是否是枚举类型
        /// </summary>
        public bool IsEnumClass { get; set; } = false;
    }
}
